home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / gnu_st.lha / gnu_st / smalltalk-1.1.1 / ReadWriteStream.st < prev    next >
Text File  |  1991-09-12  |  2KB  |  71 lines

  1. "======================================================================
  2. |
  3. |   ReadWriteStream Method Definitions
  4. |
  5.  ======================================================================"
  6.  
  7.  
  8. "======================================================================
  9. |
  10. | Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  11. | Written by Steve Byrne.
  12. |
  13. | This file is part of GNU Smalltalk.
  14. |
  15. | GNU Smalltalk is free software; you can redistribute it and/or modify it
  16. | under the terms of the GNU General Public License as published by the Free
  17. | Software Foundation; either version 1, or (at your option) any later version.
  18. | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  19. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  20. | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  21. | details.
  22. | You should have received a copy of the GNU General Public License along with
  23. | GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  24. | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  25. |
  26.  ======================================================================"
  27.  
  28.  
  29. "
  30. |     Change Log
  31. | ============================================================================
  32. | Author       Date       Change 
  33. | sbyrne     20 May 90      Fixed to accomodate changes in WriteStream.
  34. |
  35. | sbyrne     25 Apr 89      created.
  36. |
  37. "
  38.  
  39. WriteStream subclass: #ReadWriteStream
  40.         instanceVariableNames: ''
  41.         classVariableNames: ''
  42.         poolDictionaries: ''
  43.         category: nil.
  44.  
  45. ReadWriteStream comment: 
  46. 'I am the class of streams that may be read and written from simultaneously.
  47. In some sense, I am the best of both ReadStream and WriteStream.' !
  48.  
  49.  
  50. !ReadWriteStream class methodsFor: 'instance creation'!
  51.  
  52. on: aCollection
  53.     | stream |
  54.     stream _ (super on: aCollection) access: 3.
  55.     stream useWholeStream.
  56.     ^stream
  57. !!
  58.  
  59.  
  60.  
  61. !ReadWriteStream methodsFor: 'private'!
  62.  
  63. useWholeStream
  64.     "Makes sure that the contents message to this object returns the
  65.      whole contents, not just that which has been written so far."
  66.     endPtr _ collection size
  67. !!
  68.      
  69.